home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / Appearance SDK 1.0.4 / Appearance Sample Code / Headers / PInterfaces / MacWindows.p < prev    next >
Encoding:
Text File  |  1999-07-16  |  31.3 KB  |  952 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        MacWindows.p
  3.  
  4.      Contains:    Window Manager Interfaces.
  5.  
  6.      Version:    Technology:    Appearance 1.0.2
  7.                  Release:    To be used with Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT MacWindows;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __MACWINDOWS__}
  28. {$SETC __MACWINDOWS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC MacWindowsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __ALIASES__}
  35. {$I Aliases.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __APPLEEVENTS__}
  38. {$I AppleEvents.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __COLLECTIONS__}
  41. {$I Collections.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __DRAG__}
  44. {$I Drag.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __EVENTS__}
  47. {$I Events.p}
  48. {$ENDC}
  49. {$IFC UNDEFINED __MIXEDMODE__}
  50. {$I MixedMode.p}
  51. {$ENDC}
  52. {$IFC UNDEFINED __QDOFFSCREEN__}
  53. {$I QDOffscreen.p}
  54. {$ENDC}
  55. {$IFC UNDEFINED __QUICKDRAW__}
  56. {$I Quickdraw.p}
  57. {$ENDC}
  58. {$IFC UNDEFINED __TEXTCOMMON__}
  59. {$I TextCommon.p}
  60. {$ENDC}
  61. {$IFC UNDEFINED __TYPES__}
  62. {$I Types.p}
  63. {$ENDC}
  64.  
  65.  
  66. {$PUSH}
  67. {$ALIGN MAC68K}
  68. {$LibExport+}
  69.  
  70. {
  71.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  72.    • Window Definition Type
  73.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  74. }
  75.  
  76. CONST
  77.     kWindowDefProcType            = 'WDEF';
  78.  
  79. {
  80.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  81.    • Window Definition ID’s
  82.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  83. }
  84.  
  85.     kStandardWindowDefinition    = 0;                            {  for document windows and dialogs }
  86.     kRoundWindowDefinition        = 1;                            {  old da-style window }
  87.     kFloatingWindowDefinition    = 124;                            {  for floating windows }
  88.  
  89. {
  90.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  91.    • Variant Codes
  92.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  93. }
  94.                                                                 {  for use with kStandardWindowDefinition  }
  95.     kDocumentWindowVariantCode    = 0;
  96.     kModalDialogVariantCode        = 1;
  97.     kPlainDialogVariantCode        = 2;
  98.     kShadowDialogVariantCode    = 3;
  99.     kMovableModalDialogVariantCode = 5;
  100.     kAlertVariantCode            = 7;
  101.     kMovableAlertVariantCode    = 9;                            {  for use with kFloatingWindowDefinition  }
  102.     kSideFloaterVariantCode        = 8;
  103.  
  104.  
  105. {
  106.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  107.    • DefProc ID’s
  108.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  109. }
  110.  
  111.     documentProc                = 0;
  112.     dBoxProc                    = 1;
  113.     plainDBox                    = 2;
  114.     altDBoxProc                    = 3;
  115.     noGrowDocProc                = 4;
  116.     movableDBoxProc                = 5;
  117.     zoomDocProc                    = 8;
  118.     zoomNoGrow                    = 12;
  119.     rDocProc                    = 16;                            {  floating window defproc ids  }
  120.     floatProc                    = 1985;
  121.     floatGrowProc                = 1987;
  122.     floatZoomProc                = 1989;
  123.     floatZoomGrowProc            = 1991;
  124.     floatSideProc                = 1993;
  125.     floatSideGrowProc            = 1995;
  126.     floatSideZoomProc            = 1997;
  127.     floatSideZoomGrowProc        = 1999;
  128.  
  129.                                                                 {  Resource IDs for theme-savvy window defprocs  }
  130.     kWindowDocumentDefProcResID    = 64;
  131.     kWindowDialogDefProcResID    = 65;
  132.     kWindowUtilityDefProcResID    = 66;
  133.     kWindowUtilitySideTitleDefProcResID = 67;
  134.  
  135.                                                                 {  Proc IDs for theme-savvy windows  }
  136.     kWindowDocumentProc            = 1024;
  137.     kWindowGrowDocumentProc        = 1025;
  138.     kWindowVertZoomDocumentProc    = 1026;
  139.     kWindowVertZoomGrowDocumentProc = 1027;
  140.     kWindowHorizZoomDocumentProc = 1028;
  141.     kWindowHorizZoomGrowDocumentProc = 1029;
  142.     kWindowFullZoomDocumentProc    = 1030;
  143.     kWindowFullZoomGrowDocumentProc = 1031;
  144.  
  145.                                                                 {  Proc IDs for theme-savvy dialogs  }
  146.     kWindowPlainDialogProc        = 1040;
  147.     kWindowShadowDialogProc        = 1041;
  148.     kWindowModalDialogProc        = 1042;
  149.     kWindowMovableModalDialogProc = 1043;
  150.     kWindowAlertProc            = 1044;
  151.     kWindowMovableAlertProc        = 1045;
  152.  
  153. { procIDs available in Appearance 1.0.1 or later }
  154.     kWindowMovableModalGrowProc    = 1046;
  155.  
  156.                                                                 {  Proc IDs for top title bar theme-savvy floating windows  }
  157.     kWindowFloatProc            = 1057;
  158.     kWindowFloatGrowProc        = 1059;
  159.     kWindowFloatVertZoomProc    = 1061;
  160.     kWindowFloatVertZoomGrowProc = 1063;
  161.     kWindowFloatHorizZoomProc    = 1065;
  162.     kWindowFloatHorizZoomGrowProc = 1067;
  163.     kWindowFloatFullZoomProc    = 1069;
  164.     kWindowFloatFullZoomGrowProc = 1071;
  165.  
  166.  
  167.                                                                 {  Proc IDs for side title bar theme-savvy floating windows  }
  168.     kWindowFloatSideProc        = 1073;
  169.     kWindowFloatSideGrowProc    = 1075;
  170.     kWindowFloatSideVertZoomProc = 1077;
  171.     kWindowFloatSideVertZoomGrowProc = 1079;
  172.     kWindowFloatSideHorizZoomProc = 1081;
  173.     kWindowFloatSideHorizZoomGrowProc = 1083;
  174.     kWindowFloatSideFullZoomProc = 1085;
  175.     kWindowFloatSideFullZoomGrowProc = 1087;
  176.  
  177.  
  178. { Window positioning constants }
  179.     kWindowNoPosition            = $00000000;                    {  these are passed into StandardAlert and used in WIND, DLOG, and ALRT templates }
  180.     kWindowDefaultPosition        = $0000;
  181.     kWindowCenterMainScreen        = $280A;
  182.     kWindowAlertPositionMainScreen = $300A;
  183.     kWindowStaggerMainScreen    = $380A;
  184.     kWindowCenterParentWindow    = $A80A;
  185.     kWindowAlertPositionParentWindow = $B00A;
  186.     kWindowStaggerParentWindow    = $B80A;
  187.     kWindowCenterParentWindowScreen = $680A;
  188.     kWindowAlertPositionParentWindowScreen = $700A;
  189.     kWindowStaggerParentWindowScreen = $780A;
  190.  
  191. {
  192.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  193.    • GetWindowRegion Types
  194.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  195. }
  196.  
  197.  
  198.                                                                 {  Region values to pass into GetWindowRegion  }
  199.     kWindowTitleBarRgn            = 0;
  200.     kWindowTitleTextRgn            = 1;
  201.     kWindowCloseBoxRgn            = 2;
  202.     kWindowZoomBoxRgn            = 3;
  203.     kWindowDragRgn                = 5;
  204.     kWindowGrowRgn                = 6;
  205.     kWindowCollapseBoxRgn        = 7;
  206.     kWindowStructureRgn            = 32;
  207.     kWindowContentRgn            = 33;
  208.  
  209.  
  210. TYPE
  211.     WindowRegionCode                    = UInt16;
  212. { GetWindowRegionRec - used for WDEF calls with kWindowMsgGetRegion }
  213.     GetWindowRegionRecPtr = ^GetWindowRegionRec;
  214.     GetWindowRegionRec = RECORD
  215.         winRgn:                    RgnHandle;
  216.         regionCode:                WindowRegionCode;
  217.     END;
  218.  
  219.     GetWindowRegionPtr                    = ^GetWindowRegionRec;
  220.  
  221. {
  222.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  223.    • Standard Window Kinds
  224.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  225. }
  226.  
  227.  
  228. CONST
  229.     dialogKind                    = 2;
  230.     userKind                    = 8;
  231.     kDialogWindowKind            = 2;
  232.     kApplicationWindowKind        = 8;
  233.  
  234.  
  235. {
  236.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  237.    • FindWindow Result Codes
  238.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  239. }
  240.  
  241.     inDesk                        = 0;
  242.     inNoWindow                    = 0;
  243.     inMenuBar                    = 1;
  244.     inSysWindow                    = 2;
  245.     inContent                    = 3;
  246.     inDrag                        = 4;
  247.     inGrow                        = 5;
  248.     inGoAway                    = 6;
  249.     inZoomIn                    = 7;
  250.     inZoomOut                    = 8;
  251.     inCollapseBox                = 11;
  252.  
  253. {
  254.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  255.    • Window Definition Hit Test Result Codes
  256.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  257. }
  258.     wNoHit                        = 0;
  259.     wInContent                    = 1;
  260.     wInDrag                        = 2;
  261.     wInGrow                        = 3;
  262.     wInGoAway                    = 4;
  263.     wInZoomIn                    = 5;
  264.     wInZoomOut                    = 6;
  265.     wInCollapseBox                = 9;
  266.  
  267. {
  268.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  269.    • Window Definition Messages
  270.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  271. }
  272.  
  273.  
  274.     kWindowMsgDraw                = 0;
  275.     kWindowMsgHitTest            = 1;
  276.     kWindowMsgCalculateShape    = 2;
  277.     kWindowMsgInitialize        = 3;
  278.     kWindowMsgCleanUp            = 4;
  279.     kWindowMsgDrawGrowOutline    = 5;
  280.     kWindowMsgDrawGrowBox        = 6;
  281.     kWindowMsgGetFeatures        = 7;
  282.     kWindowMsgGetRegion            = 8;                            {  old names }
  283.     wDraw                        = 0;
  284.     wHit                        = 1;
  285.     wCalcRgns                    = 2;
  286.     wNew                        = 3;
  287.     wDispose                    = 4;
  288.     wGrow                        = 5;
  289.     wDrawGIcon                    = 6;
  290.  
  291.  
  292. {
  293.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  294.    • Window Features
  295.       returned by GetWindowFeatures
  296.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  297. }
  298.  
  299.     kWindowCanGrow                = $01;
  300.     kWindowCanZoom                = $02;
  301.     kWindowCanCollapse            = $04;
  302.     kWindowIsModal                = $08;
  303.     kWindowCanGetWindowRegion    = $10;
  304.     kWindowIsAlert                = $20;
  305.     kWindowHasTitleBar            = $40;
  306.  
  307.  
  308. {
  309.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  310.    • Probably don’t need this
  311.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  312. }
  313.  
  314.     deskPatID                    = 16;
  315.  
  316.  
  317.  
  318. {
  319.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  320.    • Window Color Part Codes
  321.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  322. }
  323.  
  324.     wContentColor                = 0;
  325.     wFrameColor                    = 1;
  326.     wTextColor                    = 2;
  327.     wHiliteColor                = 3;
  328.     wTitleBarColor                = 4;
  329.  
  330.  
  331. {
  332.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  333.       • Region Dragging Types
  334.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  335. }
  336.  
  337.  
  338.     kMouseUpOutOfSlop            = $80008000;
  339.  
  340. {
  341.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  342.    • Window Color Table
  343.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  344. }
  345.  
  346. TYPE
  347.     WinCTabPtr = ^WinCTab;
  348.     WinCTab = RECORD
  349.         wCSeed:                    LONGINT;                                {  reserved  }
  350.         wCReserved:                INTEGER;                                {  reserved  }
  351.         ctSize:                    INTEGER;                                {  usually 4 for windows  }
  352.         ctTable:                ARRAY [0..4] OF ColorSpec;
  353.     END;
  354.  
  355.     WCTabPtr                            = ^WinCTab;
  356.     WCTabHandle                            = ^WCTabPtr;
  357. {
  358.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  359.    • WindowRecord
  360.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  361. }
  362.     WindowRecordPtr = ^WindowRecord;
  363.     WindowPeek                            = ^WindowRecord;
  364.     WindowRecord = RECORD
  365.         port:                    GrafPort;
  366.         windowKind:                INTEGER;
  367.         visible:                BOOLEAN;
  368.         hilited:                BOOLEAN;
  369.         goAwayFlag:                BOOLEAN;
  370.         spareFlag:                BOOLEAN;
  371.         strucRgn:                RgnHandle;
  372.         contRgn:                RgnHandle;
  373.         updateRgn:                RgnHandle;
  374.         windowDefProc:            Handle;
  375.         dataHandle:                Handle;
  376.         titleHandle:            StringHandle;
  377.         titleWidth:                INTEGER;
  378.         controlList:            Handle;
  379.         nextWindow:                WindowPeek;
  380.         windowPic:                PicHandle;
  381.         refCon:                    LONGINT;
  382.     END;
  383.  
  384. {
  385.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  386.    • Color WindowRecord
  387.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  388. }
  389.     CWindowRecordPtr = ^CWindowRecord;
  390.     CWindowPeek                            = ^CWindowRecord;
  391.     CWindowRecord = RECORD
  392.         port:                    CGrafPort;
  393.         windowKind:                INTEGER;
  394.         visible:                BOOLEAN;
  395.         hilited:                BOOLEAN;
  396.         goAwayFlag:                BOOLEAN;
  397.         spareFlag:                BOOLEAN;
  398.         strucRgn:                RgnHandle;
  399.         contRgn:                RgnHandle;
  400.         updateRgn:                RgnHandle;
  401.         windowDefProc:            Handle;
  402.         dataHandle:                Handle;
  403.         titleHandle:            StringHandle;
  404.         titleWidth:                INTEGER;
  405.         controlList:            Handle;
  406.         nextWindow:                CWindowPeek;
  407.         windowPic:                PicHandle;
  408.         refCon:                    LONGINT;
  409.     END;
  410.  
  411. {
  412.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  413.    • AuxWinHandle
  414.       Windows do not necessarily have associated AuxWinHandles at this stage.
  415.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  416. }
  417.     AuxWinRecPtr = ^AuxWinRec;
  418.     AuxWinPtr                            = ^AuxWinRec;
  419.     AuxWinHandle                        = ^AuxWinPtr;
  420.     AuxWinRec = RECORD
  421.         awNext:                    AuxWinHandle;                            { handle to next AuxWinRec }
  422.         awOwner:                WindowPtr;                                { ptr to window  }
  423.         awCTable:                CTabHandle;                                { color table for this window }
  424.         reserved:                Handle;
  425.         awFlags:                LONGINT;                                { reserved for expansion }
  426.         awReserved:                CTabHandle;                                { reserved for expansion }
  427.         awRefCon:                LONGINT;                                { user Constant }
  428.     END;
  429.  
  430.  
  431. {
  432.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  433.    • Window Class Ordering
  434.       These constants are special cases passed in the “behind” parameter to
  435.       several window manager calls.
  436.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  437. }
  438.  
  439. {$IFC UNDEFINED __cplusplus }
  440.  
  441. CONST
  442.     kFirstWindowOfClass            = -1;
  443.     kLastWindowOfClass            = 0;
  444.  
  445. {$ELSEC}
  446. {$ENDC}
  447.  
  448. {
  449.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  450.    • Zoom Information Handle (WState)
  451.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  452. }
  453.  
  454.  
  455. TYPE
  456.     WStateDataPtr = ^WStateData;
  457.     WStateData = RECORD
  458.         userState:                Rect;                                    { user zoom state }
  459.         stdState:                Rect;                                    { standard zoom state }
  460.     END;
  461.  
  462.     WStateDataHandle                    = ^WStateDataPtr;
  463.  
  464. {
  465.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  466.    • PopUpWindow Types
  467.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  468. }
  469.  
  470.  
  471. {
  472.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  473.    • Window Creation & Persistence
  474.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  475. }
  476.  
  477. FUNCTION GetNewCWindow(windowID: INTEGER; wStorage: UNIV Ptr; behind: WindowPtr): WindowPtr;
  478.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  479.     INLINE $AA46;
  480.     {$ENDC}
  481. FUNCTION NewWindow(wStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: ConstStr255Param; visible: BOOLEAN; theProc: INTEGER; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: LONGINT): WindowPtr;
  482.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  483.     INLINE $A913;
  484.     {$ENDC}
  485. FUNCTION GetNewWindow(windowID: INTEGER; wStorage: UNIV Ptr; behind: WindowPtr): WindowPtr;
  486.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  487.     INLINE $A9BD;
  488.     {$ENDC}
  489. FUNCTION NewCWindow(wStorage: UNIV Ptr; {CONST}VAR boundsRect: Rect; title: ConstStr255Param; visible: BOOLEAN; procID: INTEGER; behind: WindowPtr; goAwayFlag: BOOLEAN; refCon: LONGINT): WindowPtr;
  490.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  491.     INLINE $AA45;
  492.     {$ENDC}
  493. PROCEDURE DisposeWindow(theWindow: WindowPtr);
  494.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  495.     INLINE $A914;
  496.     {$ENDC}
  497. PROCEDURE CloseWindow(theWindow: WindowPtr);
  498.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  499.     INLINE $A92D;
  500.     {$ENDC}
  501.  
  502.  
  503.  
  504.  
  505.  
  506. {
  507.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  508.    • Background Imaging
  509.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  510. }
  511.  
  512. PROCEDURE SetWinColor(theWindow: WindowPtr; newColorTable: WCTabHandle);
  513.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  514.     INLINE $AA41;
  515.     {$ENDC}
  516. PROCEDURE SetDeskCPat(deskPixPat: PixPatHandle);
  517.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  518.     INLINE $AA47;
  519.     {$ENDC}
  520.  
  521.  
  522.  
  523. {
  524.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  525.    • Low-Level
  526.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  527. }
  528.  
  529. PROCEDURE ClipAbove(window: WindowPtr);
  530.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  531.     INLINE $A90B;
  532.     {$ENDC}
  533. PROCEDURE SaveOld(window: WindowPtr);
  534.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  535.     INLINE $A90E;
  536.     {$ENDC}
  537. PROCEDURE DrawNew(window: WindowPtr; update: BOOLEAN);
  538.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  539.     INLINE $A90F;
  540.     {$ENDC}
  541. PROCEDURE PaintOne(window: WindowPtr; clobberedRgn: RgnHandle);
  542.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  543.     INLINE $A90C;
  544.     {$ENDC}
  545. PROCEDURE PaintBehind(startWindow: WindowPtr; clobberedRgn: RgnHandle);
  546.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  547.     INLINE $A90D;
  548.     {$ENDC}
  549. PROCEDURE CalcVis(window: WindowPtr);
  550.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  551.     INLINE $A909;
  552.     {$ENDC}
  553. PROCEDURE CalcVisBehind(startWindow: WindowPtr; clobberedRgn: RgnHandle);
  554.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  555.     INLINE $A90A;
  556.     {$ENDC}
  557. FUNCTION CheckUpdate(VAR theEvent: EventRecord): BOOLEAN;
  558.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  559.     INLINE $A911;
  560.     {$ENDC}
  561.  
  562.  
  563. {
  564.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  565.    • Window List
  566.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  567. }
  568.  
  569. FUNCTION FindWindow(thePoint: Point; VAR theWindow: WindowPtr): INTEGER;
  570.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  571.     INLINE $A92C;
  572.     {$ENDC}
  573. FUNCTION FrontWindow: WindowPtr;
  574.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  575.     INLINE $A924;
  576.     {$ENDC}
  577. PROCEDURE BringToFront(theWindow: WindowPtr);
  578.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  579.     INLINE $A920;
  580.     {$ENDC}
  581. PROCEDURE SendBehind(theWindow: WindowPtr; behindWindow: WindowPtr);
  582.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  583.     INLINE $A921;
  584.     {$ENDC}
  585. PROCEDURE SelectWindow(theWindow: WindowPtr);
  586.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  587.     INLINE $A91F;
  588.     {$ENDC}
  589.  
  590. {
  591.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  592.    • Misc
  593.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  594. }
  595.  
  596. PROCEDURE InitWindows;
  597.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  598.     INLINE $A912;
  599.     {$ENDC}
  600. PROCEDURE GetWMgrPort(VAR wPort: GrafPtr);
  601.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  602.     INLINE $A910;
  603.     {$ENDC}
  604. PROCEDURE GetCWMgrPort(VAR wMgrCPort: CGrafPtr);
  605.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  606.     INLINE $AA48;
  607.     {$ENDC}
  608.  
  609.  
  610. {
  611.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  612.    • Window Accessors
  613.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  614. }
  615.  
  616.  
  617. FUNCTION GetWindowFeatures(inWindow: WindowPtr; VAR outFeatures: UInt32): OSStatus;
  618.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  619.     INLINE $303C, $0013, $AA74;
  620.     {$ENDC}
  621. FUNCTION GetWindowRegion(inWindow: WindowPtr; inRegionCode: WindowRegionCode; ioWinRgn: RgnHandle): OSStatus;
  622.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  623.     INLINE $303C, $0014, $AA74;
  624.     {$ENDC}
  625.  
  626. PROCEDURE SetWRefCon(theWindow: WindowPtr; data: LONGINT);
  627.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  628.     INLINE $A918;
  629.     {$ENDC}
  630. FUNCTION GetWRefCon(theWindow: WindowPtr): LONGINT;
  631.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  632.     INLINE $A917;
  633.     {$ENDC}
  634. PROCEDURE SetWindowPic(theWindow: WindowPtr; pic: PicHandle);
  635.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  636.     INLINE $A92E;
  637.     {$ENDC}
  638. FUNCTION GetWindowPic(theWindow: WindowPtr): PicHandle;
  639.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  640.     INLINE $A92F;
  641.     {$ENDC}
  642. FUNCTION GetWVariant(theWindow: WindowPtr): INTEGER;
  643.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  644.     INLINE $A80A;
  645.     {$ENDC}
  646. {
  647.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  648.    • Update Events
  649.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  650. }
  651.  
  652. PROCEDURE InvalRect({CONST}VAR badRect: Rect);
  653.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  654.     INLINE $A928;
  655.     {$ENDC}
  656. PROCEDURE InvalRgn(badRgn: RgnHandle);
  657.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  658.     INLINE $A927;
  659.     {$ENDC}
  660. PROCEDURE ValidRect({CONST}VAR goodRect: Rect);
  661.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  662.     INLINE $A92A;
  663.     {$ENDC}
  664. PROCEDURE ValidRgn(goodRgn: RgnHandle);
  665.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  666.     INLINE $A929;
  667.     {$ENDC}
  668. PROCEDURE BeginUpdate(theWindow: WindowPtr);
  669.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  670.     INLINE $A922;
  671.     {$ENDC}
  672. PROCEDURE EndUpdate(theWindow: WindowPtr);
  673.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  674.     INLINE $A923;
  675.     {$ENDC}
  676.  
  677.  
  678. {
  679.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  680.    • Misc Imaging Stuff
  681.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  682. }
  683.  
  684.  
  685.  
  686. PROCEDURE DrawGrowIcon(theWindow: WindowPtr);
  687.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  688.     INLINE $A904;
  689.     {$ENDC}
  690. PROCEDURE HiliteWindow(theWindow: WindowPtr; fHilite: BOOLEAN);
  691.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  692.     INLINE $A91C;
  693.     {$ENDC}
  694.  
  695.  
  696.  
  697.  
  698. {
  699.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  700.    • Window Titles & Document Support
  701.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  702. }
  703.  
  704. PROCEDURE SetWTitle(theWindow: WindowPtr; title: ConstStr255Param);
  705.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  706.     INLINE $A91A;
  707.     {$ENDC}
  708. PROCEDURE GetWTitle(theWindow: WindowPtr; VAR title: Str255);
  709.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  710.     INLINE $A919;
  711.     {$ENDC}
  712.  
  713.  
  714. {
  715.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  716.    • Window Positioning
  717. }
  718. { ————————————————————————————————————————————————————————————————————————————————————————————————————————— }
  719. FUNCTION IsWindowCollapsable(inWindow: WindowPtr): BOOLEAN;
  720.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  721.     INLINE $303C, $000F, $AA74;
  722.     {$ENDC}
  723. FUNCTION IsWindowCollapsed(inWindow: WindowPtr): BOOLEAN;
  724.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  725.     INLINE $303C, $0010, $AA74;
  726.     {$ENDC}
  727. FUNCTION CollapseWindow(inWindow: WindowPtr; inCollapseIt: BOOLEAN): OSStatus;
  728.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  729.     INLINE $303C, $0011, $AA74;
  730.     {$ENDC}
  731. FUNCTION CollapseAllWindows(inCollapseEm: BOOLEAN): OSStatus;
  732.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  733.     INLINE $303C, $0012, $AA74;
  734.     {$ENDC}
  735. PROCEDURE MoveWindow(theWindow: WindowPtr; hGlobal: INTEGER; vGlobal: INTEGER; front: BOOLEAN);
  736.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  737.     INLINE $A91B;
  738.     {$ENDC}
  739. PROCEDURE SizeWindow(theWindow: WindowPtr; w: INTEGER; h: INTEGER; fUpdate: BOOLEAN);
  740.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  741.     INLINE $A91D;
  742.     {$ENDC}
  743.  
  744. PROCEDURE ZoomWindow(theWindow: WindowPtr; partCode: INTEGER; front: BOOLEAN);
  745.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  746.     INLINE $A83A;
  747.     {$ENDC}
  748. FUNCTION GrowWindow(theWindow: WindowPtr; startPt: Point; {CONST}VAR bBox: Rect): LONGINT;
  749.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  750.     INLINE $A92B;
  751.     {$ENDC}
  752. PROCEDURE DragWindow(theWindow: WindowPtr; startPt: Point; {CONST}VAR boundsRect: Rect);
  753.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  754.     INLINE $A925;
  755.     {$ENDC}
  756.  
  757. {
  758.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  759.    • Window Visibility
  760.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  761. }
  762.  
  763.  
  764. PROCEDURE HideWindow(theWindow: WindowPtr);
  765.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  766.     INLINE $A916;
  767.     {$ENDC}
  768. PROCEDURE ShowWindow(theWindow: WindowPtr);
  769.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  770.     INLINE $A915;
  771.     {$ENDC}
  772. PROCEDURE ShowHide(theWindow: WindowPtr; showFlag: BOOLEAN);
  773.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  774.     INLINE $A908;
  775.     {$ENDC}
  776.  
  777. {
  778.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  779.    • Utilities
  780.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  781. }
  782.  
  783. FUNCTION PinRect({CONST}VAR theRect: Rect; thePt: Point): LONGINT;
  784.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  785.     INLINE $A94E;
  786.     {$ENDC}
  787.  
  788. FUNCTION GetGrayRgn: RgnHandle;
  789.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  790.     INLINE $2EB8, $09EE;
  791.     {$ENDC}
  792.  
  793. {
  794.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  795.    • Window Part Tracking
  796.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  797. }
  798.  
  799. FUNCTION TrackBox(theWindow: WindowPtr; thePt: Point; partCode: INTEGER): BOOLEAN;
  800.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  801.     INLINE $A83B;
  802.     {$ENDC}
  803. FUNCTION TrackGoAway(theWindow: WindowPtr; thePt: Point): BOOLEAN;
  804.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  805.     INLINE $A91E;
  806.     {$ENDC}
  807.  
  808. {
  809.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  810.    • Region Dragging
  811.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  812. }
  813. FUNCTION DragGrayRgn(theRgn: RgnHandle; startPt: Point; {CONST}VAR limitRect: Rect; {CONST}VAR slopRect: Rect; axis: INTEGER; actionProc: DragGrayRgnUPP): LONGINT;
  814.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  815.     INLINE $A905;
  816.     {$ENDC}
  817. FUNCTION DragTheRgn(theRgn: RgnHandle; startPt: Point; {CONST}VAR limitRect: Rect; {CONST}VAR slopRect: Rect; axis: INTEGER; actionProc: DragGrayRgnUPP): LONGINT;
  818.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  819.     INLINE $A926;
  820.     {$ENDC}
  821.  
  822. {
  823.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  824.    • Cruft
  825.       Avoid using GetAuxWin, lest ye be boiled in hot oil.  AuxWinRecs are going Away.
  826.   ————————————————————————————————————————————————————————————————————————————————————————————————————————— 
  827. }
  828.  
  829. FUNCTION GetAuxWin(theWindow: WindowPtr; VAR awHndl: AuxWinHandle): BOOLEAN;
  830.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  831.     INLINE $AA42;
  832.     {$ENDC}
  833.  
  834. {
  835.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  836.    • MixedMode & ProcPtrs
  837.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  838. }
  839.  
  840.  
  841. TYPE
  842.     WindowDefProcPtr = ProcPtr;  { FUNCTION WindowDef(varCode: INTEGER; theWindow: WindowPtr; message: INTEGER; param: LONGINT): LONGINT; }
  843.  
  844.     DeskHookProcPtr = Register68kProcPtr;  { PROCEDURE DeskHook(mouseClick: BOOLEAN; VAR theEvent: EventRecord); }
  845.  
  846.     WindowDefUPP = UniversalProcPtr;
  847.     DeskHookUPP = UniversalProcPtr;
  848.  
  849. CONST
  850.     uppWindowDefProcInfo = $00003BB0;
  851.     uppDeskHookProcInfo = $00130802;
  852.  
  853. FUNCTION NewWindowDefProc(userRoutine: WindowDefProcPtr): WindowDefUPP;
  854.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  855.     INLINE $2E9F;
  856.     {$ENDC}
  857.  
  858. FUNCTION NewDeskHookProc(userRoutine: DeskHookProcPtr): DeskHookUPP;
  859.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  860.     INLINE $2E9F;
  861.     {$ENDC}
  862.  
  863. FUNCTION CallWindowDefProc(varCode: INTEGER; theWindow: WindowPtr; message: INTEGER; param: LONGINT; userRoutine: WindowDefUPP): LONGINT;
  864.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  865.     INLINE $205F, $4E90;
  866.     {$ENDC}
  867.  
  868. PROCEDURE CallDeskHookProc(mouseClick: BOOLEAN; VAR theEvent: EventRecord; userRoutine: DeskHookUPP);
  869.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  870.     {To be implemented:  Glue to move parameters into registers.}
  871.     {$ENDC}
  872. {
  873.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  874.    • C Glue
  875.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  876. }
  877.  
  878. {
  879.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  880.    • WindowRecord accessor macros
  881.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  882. }
  883.  
  884. {
  885.     *****************************************************************************
  886.     *                                                                           *
  887.     * The conditional STRICT_WINDOWS has been removed from this interface file. *
  888.     * The accessor macros to a WindowRecord are no longer necessary.            *
  889.     *                                                                           *
  890.     * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  891.     *                                                                           *
  892.     *****************************************************************************
  893.  
  894.     Details:
  895.     The original purpose of the STRICT_ conditionals and accessor macros was to
  896.     help ease the transition to Copland.  Shared data structures are difficult
  897.     to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  898.     WindowRecord and other data structures, we would begin the migration to the
  899.     discipline wherein system data structures are completely hidden from
  900.     applications.
  901.     
  902.     After many design reviews, we finally concluded that with this sort of
  903.     migration, the system could never tell when an application was no longer
  904.     peeking at a WindowRecord, and thus the data structure might never become
  905.     system owned.  Additionally, there were many other limitations in the
  906.     classic toolbox that were begging to be addressed.  The final decision was
  907.     to leave the traditional toolbox as a compatibility mode.
  908.     
  909.     We also decided to use the Handle and Ptr based types in the function
  910.     declarations.  For example, NewWindow now returns a WindowPtr rather than a
  911.     WindowRef.  The Ref types are still defined in the header files, so all
  912.     existing code will still compile exactly as it did before.  There are
  913.     several reasons why we chose to do this:
  914.     
  915.     - The importance of backwards compatibility makes it unfeasible for us to
  916.     enforce real opaque references in the implementation anytime in the
  917.     foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  918.     ControlRef, etc.) in the documentation and header files would always be a
  919.     fake veneer of opacity.
  920.     
  921.     - There exists a significant base of books and sample code that neophyte
  922.     Macintosh developers use to learn how to program the Macintosh.  These
  923.     books and sample code all use direct data access.  Introducing opaque data
  924.     types at this point would confuse neophyte programmers more than it would
  925.     help them.
  926.     
  927.     - Direct data structure access is used by nearly all Macintosh developers. 
  928.     Changing the interfaces to reflect a false opacity would not provide any
  929.     benefit to these developers.
  930.     
  931.     - Accessor functions are useful in and of themselves as convenience
  932.     functions.
  933. }
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942. {$ALIGN RESET}
  943. {$POP}
  944.  
  945. {$SETC UsingIncludes := MacWindowsIncludes}
  946.  
  947. {$ENDC} {__MACWINDOWS__}
  948.  
  949. {$IFC NOT UsingIncludes}
  950.  END.
  951. {$ENDC}
  952.